export default {
    namespaced: true,
    state: {
        //控制是否显示提示框
        isShow: false,
        toastMsg:"默认提示内容...",
        //提示图标(success成功,danger失败,warning警告)
        toastType:"warning"
    },
    mutations: {
        //修改状态
        changeIsShowToast(state, payload) {
            state.isShow = payload.isshow;
            if(payload.isshow){
                state.toastMsg=payload.msg;
                state.toastType=payload.type;
            }
        },
    },
    actions:{
        asyncIsShowToast({commit},payload){
            commit("changeIsShowToast",payload)
            setTimeout(()=>{
                commit("changeIsShowToast",{
                    isshow:false
                })
              },2000)
        }
         
    }
}